package com.ykq.controller;

import com.ykq.util.OssUtils;
import com.ykq.vo.R;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Author: 闫克起
 * @Description: 1.导入依赖[1]oss[2]commons-filerupload
 *               2.文件上传解析器
 *               3.编写文件上传接口
 * @Date: Create in 9:31 2024/10/17
 */
@RestController
public class UploadController {

    @PostMapping("/upload")
    public R upload(MultipartFile file){
        String path = OssUtils.ossUpload(file);
        return R.ok(path);
    }
}
